package com.purplesoft.zettl.Utilities;

import android.database.Cursor;

import com.purplesoft.zettl.DatabaseViews.VwPurchaseItems;

public class Item {

	// private variables
	private int ID, ManufacturerID, MeasureID, PriceID, CategoryID;
	private String Item, Description, Image, Manufacturer, Measure,
		MeasureShort, Category, Notes;
	private float Price, Amount, MeasureMin, MeasureMax, MeasureIncreaseBy;

	// emtpy constructor
	// public Item() {
	//
	// }

	// constructor
	public Item(int ID) {
		this.ID = ID;
	}

	// constructor
	public Item(String Item) {
		this.Item = Item;
	}
	
	// constructor
	public Item(int ID, float Amount) {
		this.ID = ID;
		this.Amount = Amount;
	}

	// constructor
	public Item(String Item, int ManufacturerID, int MeasureID, int PriceID,
			int CategoryID) {
		this.Item = Item;
		this.ManufacturerID = ManufacturerID;
		this.MeasureID = MeasureID;
		this.PriceID = PriceID;
		this.CategoryID = CategoryID;
	}

	// getting ID
	public int getID() {
		return this.ID;
	}

	// setting ID
	public void setID(int ID) {
		this.ID = ID;
	}

	// getting Item
	public String getItem() {
		return this.Item;
	}

	// setting Item
	public void setItem(String Item) {
		this.Item = Item;
	}

	// getting Amount
	public float getAmount() {
		return this.Amount;
	}

	// setting Amount
	public void setAmount(float Amount) {
		this.Amount = Amount;
	}

	// getting Description
	public String getDescription() {
		return this.Description;
	}

	// setting Description
	public void setDescription(String Description) {
		this.Description = Description;
	}

	// getting Image
	public String getImage() {
		return this.Image;
	}

	// setting Image
	public void setImage(String Image) {
		this.Image = Image;
	}

	// getting Manufacturer
	public String getManufacturer() {
		return this.Manufacturer;
	}

	// setting Manufacturer
	public void setManufacturer(String Manufacturer) {
		this.Manufacturer = Manufacturer;
	}

	// getting ManufacturerID
	public int getManufacturerID() {
		return this.ManufacturerID;
	}

	// setting ManufacturerID
	public void setManufacturerID(int ManufacturerID) {
		this.ManufacturerID = ManufacturerID;
	}

	// getting Measure
	public String getMeasure() {
		return this.Measure;
	}

	// setting Measure
	public void setMeasure(String Measure) {
		this.Measure = Measure;
	}

	// getting MeasureShort
	public String getMeasureShort() {
		return this.MeasureShort;
	}

	// setting MeasureShort
	public void setMeasureShort(String MeasureShort) {
		this.MeasureShort = MeasureShort;
	}

	// getting MeasureMin
	public float getMeasureMin() {
		return this.MeasureMin;
	}

	// setting MeasureMin
	public void setMeasureMin(float MeasureMin) {
		this.MeasureMin = MeasureMin;
	}

	// getting MeasureMax
	public float getMeasureMax() {
		return this.MeasureMax;
	}

	// setting MeasureMax
	public void setMeasureMax(float MeasureMax) {
		this.MeasureMax = MeasureMax;
	}

	// getting MeasureIncreaseBy
	public float getMeasureIncreaseBy() {
		return this.MeasureIncreaseBy;
	}

	// setting MeasureMax
	public void setMeasureIncreaseBy(float MeasureIncreaseBy) {
		this.MeasureIncreaseBy = MeasureIncreaseBy;
	}

	// getting MeasureID
	public int getMeasureID() {
		return this.MeasureID;
	}

	// setting MeasureID
	public void setMeasureID(int MeasureID) {
		this.MeasureID = MeasureID;
	}

	// getting Price
	public float getPrice() {
		return this.Price;
	}

	// setting Price
	public void setPrice(float Price) {
		this.Price = Price;
	}

	// getting PriceID
	public int getPriceID() {
		return this.PriceID;
	}

	// setting PriceID
	public void setPriceID(int PriceID) {
		this.PriceID = PriceID;
	}

	// getting Category
	public String getCategory() {
		return this.Category;
	}

	// setting Category
	public void setCategory(String Category) {
		this.Category = Category;
	}

	// getting CategoryID
	public int getCategoryID() {
		return this.CategoryID;
	}

	// setting PriceID
	public void setCategoryID(int CategoryID) {
		this.CategoryID = CategoryID;
	}

	// getting Notes
	public String getNotes() {
		return this.Notes;
	}

	// setting Notes
	public void setNotes(String Notes) {
		this.Notes = Notes;
	}

	public void setItemAllAttributes(Cursor cursor) {
		setID(cursor.getInt(cursor.getColumnIndex(VwPurchaseItems.Columns.ItemID)));
		setItem(cursor.getString(cursor
				.getColumnIndex(VwPurchaseItems.Columns.Item)));
		setAmount(cursor.getFloat(cursor
				.getColumnIndex(VwPurchaseItems.Columns.Amount)));
		setDescription(cursor.getString(cursor
				.getColumnIndex(VwPurchaseItems.Columns.ItemDescription)));
		setImage(cursor.getString(cursor
				.getColumnIndex(VwPurchaseItems.Columns.ItemImg)));
		setManufacturer(cursor.getString(cursor
				.getColumnIndex(VwPurchaseItems.Columns.Manufacturer)));
		setManufacturerID(cursor.getInt(cursor
				.getColumnIndex(VwPurchaseItems.Columns.ManufacturerID)));
		setMeasure(cursor.getString(cursor
				.getColumnIndex(VwPurchaseItems.Columns.Measure)));
		setMeasureShort(cursor.getString(cursor
				.getColumnIndex(VwPurchaseItems.Columns.MeasureShort)));
		setMeasureMin(cursor.getFloat(cursor
				.getColumnIndex(VwPurchaseItems.Columns.Min)));
		setMeasureMax(cursor.getFloat(cursor
				.getColumnIndex(VwPurchaseItems.Columns.Max)));
		setMeasureIncreaseBy(cursor.getFloat(cursor
				.getColumnIndex(VwPurchaseItems.Columns.IncreaseBy)));
		setMeasureID(cursor.getInt(cursor
				.getColumnIndex(VwPurchaseItems.Columns.MeasureID)));
		setPrice(cursor.getFloat(cursor
				.getColumnIndex(VwPurchaseItems.Columns.Price)));
//		setPriceID(cursor.getInt(cursor
//				.getColumnIndex(VwPurchaseItems.Columns.PriceID)));
		setCategory(cursor.getString(cursor
				.getColumnIndex(VwPurchaseItems.Columns.CategoryName)));
		setCategoryID(cursor.getInt(cursor
				.getColumnIndex(VwPurchaseItems.Columns.CategoryID)));
		setNotes(cursor.getString(cursor
				.getColumnIndex(VwPurchaseItems.Columns.Notes)));
	}
	
}

